<template>
  <div class="aboutBottom">
    <div class="title">评论</div>
    <div class="container">
      <div class="letf">
        <div class="commont">
          <ComPub />
          <div class="content">
            <div v-for="item in comment" :key="item.id" class="items">
              <h5>
                <span
                  class="ant-avatar ant-avatar-circle"
                  :style="`background-color:#${item.id.slice(-6)}`"
                >
                  <span
                    class="ant-avatar-string"
                    style="
                      line-height: 28px;
                      transform: scale(1) translateX(-50%);
                    "
                    >{{ item.name.slice(0, 1) }}</span
                  >
                </span>
                <span>{{ item.name }}</span>
              </h5>
              <p v-html="item.content" style="margin-left: 30px"></p>
              <div style="margin-left: 30px; margin-top: 20px; color: #ccc">
                <span>{{ item.userAgent }}</span
                >&nbsp;·&nbsp;<span style="color: black">{{
                  moment(item.updateAt, "YYYYMMDD").fromNow()
                }}</span
                >&nbsp;
                <span>
                  <svg
                    viewBox="64 64 896 896"
                    focusable="false"
                    data-icon="message"
                    width="1em"
                    height="1em"
                    fill="currentColor"
                    aria-hidden="true"
                  >
                    <path
                      d="M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z"
                    ></path>
                  </svg>
                  Reply
                </span>
              </div>
              <ComChild :item="item" />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import ComChild from "../About/Commentchild/ComChild.vue";
import ComPub from "../About/Commentchild/ComPub.vue";
import moment from "moment";
export default {
  data() {
    return {
      moment: moment,
    };
  },
  props: ["comment"],
  components: {
    ComPub,
    ComChild,
  },
};
</script>

<style lang="scss">
.aboutBottom {
  width: 100%;
  .title {
    margin-bottom: 16px;
    color: var(--main-text-color);
    font-weight: 500;
    font-size: 18px;
    margin-top: 16px;
    line-height: 22px;
    text-align: center;
    letter-spacing: 0.06em;
  }
  .commont {
    padding-top: 10px;
    width: 73%;
    height: 100%;
    background-color: var(--bg);
    .content {
      width: 70%;
      .items {
        width: 95%;
        margin: 20px auto;
        border-top: 1px solid #ccc;
        h5 {
          span {
            font-weight: bolder;
          }
        }
        .ant-avatar {
          display: inline-block;
          border-radius: 50px;
          text-align: center;
          width: 30px;
          height: 30px;
          line-height: 30px;
          font-size: 18px;
        }
      }
    }
  }
}
</style>
